using System;
using System.Collections.Generic;
using System.Text;
using BusinessObjects.BO_Actions;
using Entity.StoreProcedure;
using BusinessObjects;
using System.Data;
namespace BusinessObjects.BO_GetObjects {
    public static class BO_cms_user_access_log {
        public static DataTable SelectAll(int status) {
            try {
                usp_cms_user_access_log_select_all entity = new usp_cms_user_access_log_select_all();
                entity.STATUS = status;
                return BO_Actions<usp_cms_user_access_log_select_all>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable SelectTop(int rows, int status) {
            try {
                usp_cms_user_access_log_select_top entity = new usp_cms_user_access_log_select_top();
                entity.NUMBERRECORD = rows;
                entity.STATUS = status;
                return BO_Actions<usp_cms_user_access_log_select_top>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable Search(int log_id) {
            try {
                usp_cms_user_access_log_search entity = new usp_cms_user_access_log_search();
                entity.LOG_ID = log_id;

                return BO_Actions<usp_cms_user_access_log_search>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable SelectWithPaged(int startIndex, int pageCount, int status) {
            try {
                usp_cms_user_access_log_select_paged entity = new usp_cms_user_access_log_select_paged();
                entity.STARTINDEX = startIndex;
                entity.MAXRECORDS = pageCount;
                entity.STATUS = status;
                return BO_Actions<usp_cms_user_access_log_select_paged>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static string Insert(string module_name, int user_id, string ip_address, DateTime access_date, bool status) {
            try {
                usp_cms_user_access_log_insert entity = new usp_cms_user_access_log_insert();
                entity.MODULE_NAME = module_name;
                entity.USER_ID = user_id;
                entity.IP_ADDRESS = ip_address;
                entity.ACCESS_DATE = access_date;
                entity.STATUS = status;

                return BO_Actions<usp_cms_user_access_log_insert>.ExecuteAndReturnStringValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static string Update(Int64 log_id, string module_name, int user_id, string ip_address, DateTime access_date, bool status) {
            try {
                usp_cms_user_access_log_update entity = new usp_cms_user_access_log_update();
                entity.LOG_ID = log_id;
                entity.MODULE_NAME = module_name;
                entity.USER_ID = user_id;
                entity.IP_ADDRESS = ip_address;
                entity.ACCESS_DATE = access_date;
                entity.STATUS = status;

                return BO_Actions<usp_cms_user_access_log_update>.ExecuteAndReturnStringValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static bool Delete(string ids, string spliter, int delete_type) {
            try {
                usp_cms_user_access_log_delete entity = new usp_cms_user_access_log_delete();
                entity.IDS = ids;
                entity.SPLITER = spliter;
                entity.DELETE_TYPE = delete_type;

                return BO_Actions<usp_cms_user_access_log_delete>.ExecuteAndReturnBooleanValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static bool Restore(int log_id) {
            try {
                usp_cms_user_access_log_restore entity = new usp_cms_user_access_log_restore();
                entity.LOG_ID = log_id;

                return BO_Actions<usp_cms_user_access_log_restore>.ExecuteAndReturnBooleanValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static DataTable SelectAdmin(string keywords, int startIndex, int pageCount, int status) {
            try {
                usp_cms_user_access_log_select_admin entity = new usp_cms_user_access_log_select_admin();
                entity.KEYWORDS = keywords;
                entity.STARTINDEX = startIndex;
                entity.MAXRECORDS = pageCount;
                entity.STATUS = status;
                return BO_Actions<usp_cms_user_access_log_select_admin>.ExecuteAndReturnDataTable(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
        public static bool Delete() {
            try {
                usp_cms_user_access_log_delete_all entity = new usp_cms_user_access_log_delete_all();
                return BO_Actions<usp_cms_user_access_log_delete_all>.ExecuteAndReturnBooleanValue(entity);
            } catch (Exception ex) {
                throw ex;
            }
        }
    }
}

